import { RouteRecordRaw } from 'vue-router';
import AsyncComponent from '../utils/async-component';

const BaseRoute: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'login',
    component: AsyncComponent(() => import('@/views/login.vue'))
  },
  {
    path: '/test-paper-edit/:preview/:id/:syncPractice?',
    name: 'test-paper-edit',
    meta: { title: '编辑试卷' },
    component: () => import('@/views/test-paper/update/index.vue')
  },
  {
    path: '/handout/:preview/:id/:subjectId',
    name: 'handout',
    meta: { title: '编辑讲义' },
    component: () => import('@/views/handout/index.vue')
  },
  {
    path: '/error',
    name: 'error',
    component: AsyncComponent(() => import('@/views/error.vue'))
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/error'
  }
]

export default BaseRoute;
